package com.plian.system.entity.dsh;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import com.plian.system.vo.hr.staff.StaffFilesVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@TableName("dsh_staff_management")
@EqualsAndHashCode(callSuper = true, exclude = "dataSource,dataSourceId")
@ApiModel(value = "董事会档案", description = "董事会档案")
public class DshStaffManagement extends BaseEntity {

    /**
     * 主表主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主表主键")
    private Long staffFilesId;

    /**
     * 单位
     */
    @ApiModelProperty(value = "单位")
    private String companyId;

    /**
     * 人员姓名
     */
    @ApiModelProperty(value = "人员姓名", required = true)
    private String staffName;

    /**
     * 是否为本企业人员（1否2是）
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "是否为本企业人员（1否2是）", required = true)
    private Integer isOutSupervisor;

    /**
     * 董事职务id
     */
    @ApiModelProperty(value = "董事职务id", required = true)
    private String supervisorPositionId;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别", required = true)
    private String genderId;

    /**
     * 出生日期
     */
    @TableField(value = "BIRTHDAY",updateStrategy = FieldStrategy.IGNORED)
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    @ApiModelProperty(value = "出生日期", required = true)
    private Date birthday;

    /**
     * 任职时间
     */
    @ApiModelProperty(value = "任职时间")
    private String appointmentTime;

    @ApiModelProperty(value = "单据类型")
    private String formType;

    @TableField(exist = false)
    private StaffFilesVO staffFilesVO;

    /**
     * 数据来源 null为系统填报 对应用户id
     */
    @ApiModelProperty(value = "数据来源 null为系统填报 对应用户id", required = true)
    private String dataSource;

    /**
     * 数据来源id
     */
    @ApiModelProperty(value = "数据来源id", required = true)
    private String dataSourceId;

    /**
     * 任现职时间
     */
    private String tenureTime;

    /**
     * 任职董事时间
     */
    private String directorTenureTime;
    /**
     * 审批人
     */
    @ApiModelProperty(value = "审批人")
    private String approvedUser;
    /**
     * 审批时间
     */
    @ApiModelProperty(value = "审批时间")
    private Date approvedTime;

    /**
     * 单据编码
     */
    @ApiModelProperty(value = "单据编码")
    private String code;
}
